package com.itheima.demo03functionalinterface;

import java.util.function.Function;

/**
 * @author chenming
 * Date  2023/6/13 17:00
 * @version 1.0
 * description
 */
public class Demo05Function {

    //使用lambda表达式将字符串转化为数字
    public static void main(String[] args) {
        System.out.println("开始");
        getNumber(Integer::parseInt,"10");
    }

    private static void getNumber(Function<String,Integer> function,String str) {
        Integer num = function.apply(str);
        System.out.println("num=" + num);
    }

}
